<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="com.bill.common.system.service.ITransactionRecordService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="../language.jsp" %>
<%
	if(session.getAttribute("loginName")==null){
		response.sendRedirect( "login.jsp");
		return;
	}
	if(session.getAttribute("password2")==null){
		response.sendRedirect( "login2.jsp?pageUrl=user/subreg.jsp");
		return;
	}
	request.setAttribute("registerLocation",request.getParameter("registerLocation"));
	request.setAttribute("contactNo",request.getParameter("contactNo"));
	
	ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
	ITransactionRecordService transactionRecordService = (ITransactionRecordService)ac.getBean("transactionRecordService");
	Double staticBalance = transactionRecordService.findUserBalance(session.getAttribute("loginName").toString(),"Static");
	
	request.setAttribute("staticBalance",staticBalance);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1" >
<title><fmt:message key="i18n.userReg"/>-<fmt:message key="i18n.title"/></title>
<link rel="shortcut icon" href="../index/favicon.png" />
<link href="../skin/skin1/css/css.css" rel="stylesheet">
</head>
<body style="background:#fff;height:800px;">
<div class="account">
	<!-- <div class="left"></div> -->
    <div class="right" style="margin: 0px;">
    	<div style="margin-bottom: 10px;">
    		<fmt:message key="i18n.userCenter"/> &gt; <fmt:message key="i18n.subAccountReg"/>
    	</div>
	    <%-- <div class="top1">
		</div>
		 --%>
    	<div id="registerMainContent" style="">
	      <table width="100%" border="0" cellspacing="0" cellpadding="0">
	        <tr> <th scope="col" align="left">
	        	<span style="color:red;font-size:16px;"><fmt:message key="i18n.jtAccount" />:${staticBalance }</span>
				<span>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="subAccountList.jsp"><fmt:message key="SubAccount"/><fmt:message key="i18n.list"/></a></span>
	        </th> </tr>
	        <tr>
	          <td class="bdxx">
	          <form action="registerUser!saveRegiserUser.action" method="post" id="register_form">
	          	<input type="hidden" value="subAccount" name="registerUserDTO.subAccount"  />
	          	<input type="hidden" value="${session.loginName}" name="registerUserDTO.parentAccount" />
	          	<div class="verBox div_hiden" style="display: none;">
     					<span class="regw110"><fmt:message key="i18n.userlevel" />:</span>
     					<div class="verbTxt">
     						<select class="regSele" name="registerUserDTO.registerLevel">
     							<%-- <option value="L1"><fmt:message key="L1" /></option>
     							<option value="L2"><fmt:message key="L2" /></option>
     							<option value="L3"><fmt:message key="L3" /></option>
     							<option value="L4"><fmt:message key="L4" /></option>
     							<option value="L5"><fmt:message key="L5" /></option>
     							<option value="L6"><fmt:message key="L6" /></option> --%>
     							<option value="L7"><fmt:message key="L7" /></option>
     							<%-- <option value="L8"><fmt:message key="L8" /></option> --%>
     						</select>
     					</div>
     				</div>
					<div class="verBox div_hiden" style="display: none;">
     					<span class="regw110"><fmt:message key="position" />:</span>
     					<div class="verbTxt">
     						<fmt:message key="i18n.left" />：<input type="radio" name="registerUserDTO.registerLocation"  id="registerLocation_aArea" checked="checked" value="aArea" />
							<fmt:message key="i18n.right" />：<input type="radio" name="registerUserDTO.registerLocation"  id="registerLocation_bArea" <c:if test="${registerLocation eq 'bArea' }"> checked="checked" </c:if> value="bArea" />
     					</div>
     				</div>
                    <p>
	            		<span><fmt:message key="i18n.userRegAccount"/>：</span>
	            		<input name="registerUserDTO.loginName" id="reg_loginName" readonly="readonly" class="srk"/>&nbsp;<label class="tip">*</label>
	            		<label class="tip tipText">&nbsp;</label>
	            		<a href="javascript:randomNo('reg_loginName')">[<fmt:message key="i18n.reShengCheng"/>]</a>
	            	</p>
                    <p>
	            		<span><fmt:message key="i18n.piUserName"/>：</span>
	            		<input name="registerUserDTO.userName" id="reg_userName" class="srk"/>&nbsp;<label class="tip">*</label>
	            		<label class="tip tipText">&nbsp;</label>
	            	</p>
	            	<p>
	            		<c:if test="${not empty session.activationTime}">
	            			<span>&nbsp;</span><input class="cx_an1" type="button" value="<fmt:message key="i18n.submitReg"/>" onclick="regSubmit()" />
                    	</c:if>
	            	</p>
	          </form>
	          </td>
	        </tr>
	      </table>
	    </div>
	</div>
</div>
<script type="text/javascript" src="../scripts/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../scripts/user/common.js"></script>
<script type="text/javascript" src="../scripts/user/reguser.js"></script>
<script type="text/javascript">

$(function(){
	randomNo('reg_loginName');
	$('#reg_registerLocation').val('${param.registerLocation}');
	document.onkeydown = function(evt){
		var evt = window.event?window.event:evt;
		if(evt.keyCode==13){
			regSubmit();
		}
	}
});	
</script>

</body>
</html>